﻿@model DCH.Areas.Admin.Models.News

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm(null, null, FormMethod.Post, new { enctype="multipart/form-data"}))
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>News</legend>

        <div class="editor-label">
           Image
        </div>
        <div class="editor-field">
            <input type="file" name="file" id="file" />
            @Html.HiddenFor(model => model.imageThumbnail)
        @*    @Html.(model => model.imageThumbnail)
            @Html.ValidationMessageFor(model => model.imageThumbnail)*@
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.description)
        </div>
        <div class="editor-field">
              @Html.TextAreaFor(model => model.description, new { @class = "ckeditor", @id = "Description" })
            @Html.ValidationMessageFor(model => model.description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Date)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Date)
            @Html.ValidationMessageFor(model => model.Date)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
<script type="text/javascript">
    var editor = CKEDITOR.instances["editor1"];
    if(editor){editor.distroy(true);}
    CKEDITOR.replace("description", {
        enderMode:CKEDITOR.ENTER_BR,
    });
    CKFinder.setupCKEditor(null,'@Url.Content("~/ckfinder/")')
</script>
